$(function () {
});




var vm = new Vue({
    el:'#rrapp',
    data:{
        q:{
            title: null
        },
        showList: true,
        title:null,
        siteAbout:{
            status:0
        }
    },
    created:function () {

        $.get(baseURL + "orth/siteAboutManage/info/1", function(r){
            vm.siteAbout = r.siteAbout;
            um.setContent(vm.siteAbout.content);
        });
    },
    methods: {
        query: function () {

        },
        update: function () {

            var userId=1;
            vm.title = "修改";
            vm.getUser(userId);
        },
        saveOrUpdate: function () {

            if(!$(".form-horizontal").validationEngine("validate")) {
                $(".formError").show();
                return;
            }
            vm.siteAbout.content=um.getContent();
            var url ="orth/siteAboutManage/update";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.siteAbout),
                success: function(r){
                    if(r.code === 0){
                        alert('操作成功', function(){
                        });
                    }else{
                        alert(r.msg);
                    }
                }
            });
        },
        getUser: function(id){
            $.get(baseURL + "orth/siteAboutManage/info/"+id, function(r){
                vm.siteAbout = r.siteAbout;
            });
        },
        validator: function () {
        }
    }
});